package com.yict.csms.system.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * 菜单表Entity
 * 
 * @author Patrick.Deng
 * 
 */
@Entity
@Table(name = "CSMS_TREENODE")
public class TreeNode {

	@Id
	@Column(name = "NODEID")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "csms_treenode_seq")
	@SequenceGenerator(name = "csms_treenode_seq", sequenceName = "SEQ_CSMS_TREENODE", allocationSize = 1, initialValue = 1)
	private Long nodeId;

	@Column(name = "NODECODE")
	private String nodeCode;
	
	@Column(name = "NODENAME")
	private String nodeName;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PARENTNODEID")
	private TreeNode parentNodeId;

	@Column(name = "TLEVEL")
	private int tlevel;

	@Column(name = "PRIORITY")
	private int priority;
	
	@Column(name = "LEAF")
	private int leaf;

	@Column(name = "TCONNECT")
	private String tconnect;

	@Column(name = "REMARKS")
	private String remarks;

	@Column(name = "CREATEDATE")
	private Date createDate;

	@Column(name = "UPDATEDATE")
	private Date updateDate;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CREATEPERSON")
	private User createPerson;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "UPDATEPERSON")
	private User updatePerson;

	public Long getNodeId() {
		return nodeId;
	}

	public void setNodeId(Long nodeId) {
		this.nodeId = nodeId;
	}

	public String getNodeCode() {
		return nodeCode;
	}

	public void setNodeCode(String nodeCode) {
		this.nodeCode = nodeCode;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public User getCreatePerson() {
		return createPerson;
	}

	public void setCreatePerson(User createPerson) {
		this.createPerson = createPerson;
	}

	public User getUpdatePerson() {
		return updatePerson;
	}

	public void setUpdatePerson(User updatePerson) {
		this.updatePerson = updatePerson;
	}

	public String getNodeName() {
		return nodeName;
	}

	public void setNodeName(String nodeName) {
		this.nodeName = nodeName;
	}

	public TreeNode getParentNodeId() {
		return parentNodeId;
	}

	public void setParentNodeId(TreeNode parentNodeId) {
		this.parentNodeId = parentNodeId;
	}

	public int getTlevel() {
		return tlevel;
	}

	public void setTlevel(int tlevel) {
		this.tlevel = tlevel;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}

	public String getTconnect() {
		return tconnect;
	}

	public void setTconnect(String tconnect) {
		this.tconnect = tconnect;
	}

	public int getLeaf() {
		return leaf;
	}

	public void setLeaf(int leaf) {
		this.leaf = leaf;
	}
}
